<a href="https://github.com/socketstream/socketstream/edit/master/lib/utils/misc.js" class="improve-docs"><i class="icon-edit"> </i>Improve this doc</a><a href="https://github.com/socketstream/socketstream/blob/3f3f67a/lib/utils/misc.js#L13" class="view-source"><i class="icon-eye-open"> </i>View source</a><h1><code ng:non-bindable="">misc</code>
<div><span class="hint">service in module <code ng:non-bindable="">utils</code>
</span>
</div>
</h1>
<div><h2 id="description">Description</h2>
<div class="description"><div class="utils-misc-page utils-misc-misc-page"><p>Module contains misc methods</p>
</div></div>
<div class="member method"><h2 id="methods">Methods</h2>
<ul class="methods"><li><a href="https://github.com/socketstream/socketstream/blob/3f3f67a/lib/utils/misc.js#L102" class="view-source icon-eye-open"> </a><h3 id="methods_defaults">defaults(args, defaults)</h3>
<div class="defaults"><div class="utils-misc-defaults-page"><p>Useful for declaring default parameter</p>
</div><h5 id="methods_defaults_parameters">Parameters</h5><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>args</td><td><a href="" class="label type-hint type-hint-object">Object</a></td><td><div class="utils-misc-defaults-page"><p>Arguments</p>
</div></td></tr><tr><td>defaults</td><td><a href="" class="label type-hint type-hint-object">Object</a></td><td><div class="utils-misc-defaults-page"><p>Default arguments</p>
</div></td></tr></tbody></table><h5 id="methods_defaults_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-object">Object</a></td><td><div class="utils-misc-defaults-page"><p>Extended object</p>
</div></td></tr></table></div>
</li>
<li><a href="https://github.com/socketstream/socketstream/blob/3f3f67a/lib/utils/misc.js#L73" class="view-source icon-eye-open"> </a><h3 id="methods_extend">extend(obj, &lt;objects&gt;)</h3>
<div class="extend"><div class="utils-misc-extend-page"><p>Taken from underscore.js</p>
</div><h5 id="methods_extend_parameters">Parameters</h5><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>obj</td><td><a href="" class="label type-hint type-hint-object">Object</a></td><td><div class="utils-misc-extend-page"><p>Object to extend</p>
</div></td></tr><tr><td><objects></td><td><a href="" class="label type-hint type-hint-object">&lt;Objects&gt;</a></td><td><div class="utils-misc-extend-page"><p>to extend with</p>
</div></td></tr></tbody></table><h5 id="methods_extend_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-object">Object</a></td><td><div class="utils-misc-extend-page"><p>Extended object</p>
</div></td></tr></table></div>
</li>
<li><a href="https://github.com/socketstream/socketstream/blob/3f3f67a/lib/utils/misc.js#L51" class="view-source icon-eye-open"> </a><h3 id="methods_parsewsmessage">parseWsMessage(msg)</h3>
<div class="parsewsmessage"><div class="utils-misc-parsewsmessage-page"><p>Parse incoming websocket messages into message type and contents</p>
</div><h5 id="methods_parsewsmessage_parameters">Parameters</h5><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>msg</td><td><a href="" class="label type-hint type-hint-string">String</a></td><td><div class="utils-misc-parsewsmessage-page"><p>Message to parse</p>
</div></td></tr></tbody></table><h5 id="methods_parsewsmessage_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-array">Array</a></td><td><div class="utils-misc-parsewsmessage-page"><p>Array, where [0] is message type, [1] is message&#39;s body</p>
</div></td></tr></table></div>
</li>
<li><a href="https://github.com/socketstream/socketstream/blob/3f3f67a/lib/utils/misc.js#L27" class="view-source icon-eye-open"> </a><h3 id="methods_randomstring">randomString(len)</h3>
<div class="randomstring"><div class="utils-misc-randomstring-page"><p>Adapted from <a href="http://www.broofa.com/Tools/Math.uuid.js">http://www.broofa.com/Tools/Math.uuid.js</a></p>
</div><h5 id="methods_randomstring_parameters">Parameters</h5><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>len</td><td><a href="" class="label type-hint type-hint-string">String</a></td><td><div class="utils-misc-randomstring-page"><p>Length of the expected string</p>
</div></td></tr></tbody></table><h5 id="methods_randomstring_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-string">String</a></td><td><div class="utils-misc-randomstring-page"><p>uuid string</p>
</div></td></tr></table></div>
</li>
</ul>
</div>
</div>
